<template>
	<div class="article-details">
		<nav-bar :back="1" :title="title" :isShowShare="true"></nav-bar>
		<div class="article">
			<iframe :src="url" class="article-ifarme"></iframe>
		</div>
	</div>
</template>

<script>
	import {
		Toast
	} from 'vant';

	import NavBar from '../../components/NavBar.vue';

	export default {
		name: 'article-details',
		components: {
			NavBar
		},
		data() {
			return {
				isLoading: false,
			}
		},
		methods: {
			onRefresh() {
				setTimeout(() => {
					Toast('刷新成功');
					this.isLoading = false;
				}, 1000);
			}
		},
		computed: {
			title() {
				if (this.$route.params.title) {
					return this.$route.params.title
				} else if (window.localStorage.getItem('params')) {
					return JSON.parse(window.localStorage.getItem('params')).title
				} else {
					return ''
				}
			},
			url() {
				if (this.$route.params.url) {
					return this.$route.params.url
				} else if (window.localStorage.getItem('params')) {
					return JSON.parse(window.localStorage.getItem('params')).url
				} else {
					return ''
				}
			}
		}
	}
</script>

<style scoped>
	.article-panel {
		width: 100%;
		height: 100%;
		padding-top: 0.88rem;
		background-color: #F6F5FB;
	}

	.article {
		width: 100%;
		min-height: 100vh;
		padding-top: 0.88rem;
	}

	.article-ifarme {
		width: 100%;
		min-height: calc(100vh - 0.88rem);
	}
</style>
